﻿using System;
using System.Collections.Generic;
using System.Text;
using T.FAS.Runtime.Expression.Entity;
using T.ServiceComponent.Database.Service;

namespace T.FAS.Runtime.Expression.Dev.Dao.Logic
{
    public class ExprMetaDataLogic
    {
        ExprMetaDataDao exprMetaDataDao = new ExprMetaDataDao();
        /// <summary>
        /// 新增
        /// </summary>
        /// <param name="exprMetaData"></param>
        public void AddExprMetaData(ExprMetaData exprMetaData)
        {
            exprMetaData.ID = Guid.NewGuid().ToString();
            exprMetaData.Creator = ExprItemLogic.userName;
            exprMetaData.CreateTime = DateTime.Now;
            exprMetaData.LastModifier = ExprItemLogic.userName;
            exprMetaData.LastModifyTime = DateTime.Now;
            exprMetaDataDao.Add(new List<object> { exprMetaData });
        }
        /// <summary>
        /// 根据ID查询
        /// </summary>
        /// <param name="ID"></param>
        /// <returns></returns>
        public ExprMetaData GetExprMetaData(string ID)
        {
            return exprMetaDataDao.GetObject(ID);
        }
        /// <summary>
        /// 获取元数据列表
        /// </summary>
        /// <returns></returns>
        public List<ExprMetaData> GetExprMetaDataList()
        {
            return exprMetaDataDao.GetExprMetaDataList();
        }
    }
}
